home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Container / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  4.6 KB  |  151 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. #ifndef FWPARTNG_H
  14. #include "FWPartng.h"
  15. #endif
  16.  
  17. #ifndef FWSELECT_H
  18. #include "FWSelect.h"
  19. #endif
  20.  
  21. #ifndef FWCOLOR_H
  22. #include "FWColor.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CContent;
  30. class FW_CGraphicContext;
  31. class FW_CMenuBar;
  32. class FW_CMenuEvent;
  33. class FW_CMouseEvent;
  34. class FW_CPresentation;
  35.  
  36. class CProxy;
  37. class CPartContent;
  38. class CContainerSelection;
  39.  
  40. //========================================================================================
  41. //    class CContainerPart
  42. //========================================================================================
  43.  
  44. class CContainerPart : public FW_CEmbeddingPart
  45. {
  46.   public:
  47.     FW_DECLARE_CLASS
  48.     FW_DECLARE_AUTO(CContainerPart)
  49.     
  50. //----------------------------------------------------------------------------------------
  51. //    Initialization/Destruction
  52. //
  53.   public:        
  54.     CContainerPart(ODPart* odPart);
  55.     virtual ~ CContainerPart();
  56.  
  57.     virtual void            Initialize(Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  58.     
  59. //----------------------------------------------------------------------------------------
  60. //    Inherited API
  61. //
  62.   public:
  63.     virtual FW_Handled            DoMenu(Environment* ev, 
  64.                                     const FW_CMenuEvent& theMenuEvent);
  65.     virtual FW_Handled            DoAdjustMenus(Environment* ev, 
  66.                                     FW_CMenuBar* menuBar, 
  67.                                     FW_Boolean hasMenuFocus, 
  68.                                     FW_Boolean isRoot);
  69.     
  70.     virtual FW_Handled            DoAbout(Environment* ev);
  71.  
  72.     virtual FW_CFrame*             NewFrame(Environment* ev,
  73.                                     ODFrame* odFrame, 
  74.                                     FW_CPresentation* presentation,
  75.                                     FW_Boolean fromStorage);
  76.                                     
  77.     virtual FW_CContent*        NewPartContent(Environment* ev);
  78.  
  79.     virtual void                EmbeddedFrameRemoved(Environment *ev, FW_MProxy* proxy);
  80.  
  81. //----------------------------------------------------------------------------------------
  82. //    New API
  83. //
  84.   public:    
  85.     void                AddProxyToPart(Environment* ev, CProxy* proxy);
  86.  
  87.     void                DetachProxy(Environment* ev, CProxy* proxy);
  88.     void                AttachProxy(Environment* ev, CProxy* proxy);
  89.  
  90.     void                DeleteProxy(Environment* ev, CProxy* proxy);
  91.     
  92.     CProxy*             WhichProxy(Environment* ev, 
  93.                                     FW_CGraphicContext& gc,
  94.                                     const FW_CPoint& where,
  95.                                     FW_Boolean hasToBeSelected) const;
  96.  
  97.     FW_CPoint            GetDrawingSize() const;
  98.     FW_CPresentation*    GetMainPresentation() const;
  99.     CPartContent*        GetPartContent() const;
  100.  
  101.     FW_CColor            GetBackgroundColor() const;
  102.     void                SetBackgroundColor(Environment* ev, const FW_CColor& newBackColor);
  103.  
  104. //----------------------------------------------------------------------------------------
  105. //    Data Members
  106. //
  107.   private:    
  108.     CPartContent*        fPartContent;
  109.  
  110.     CContainerSelection* fContainerSelection;    // Attention I don't own the selection the presentation is
  111.     FW_CPresentation*    fMainPresentation;
  112.  
  113.     FW_CPoint            fDrawingSize;
  114. };
  115.  
  116. //========================================================================================
  117. //    Inlines
  118. //========================================================================================
  119.  
  120. //----------------------------------------------------------------------------------------
  121. //    CContainerPart::GetPartContent
  122. //----------------------------------------------------------------------------------------
  123. inline CPartContent* CContainerPart::GetPartContent() const
  124. {
  125.     return fPartContent;
  126. }
  127.  
  128. //----------------------------------------------------------------------------------------
  129. //    CContainerPart::GetDrawingSize
  130. //----------------------------------------------------------------------------------------
  131. inline FW_CPoint CContainerPart::GetDrawingSize() const
  132. {
  133.     return fDrawingSize;
  134. }
  135.  
  136. //----------------------------------------------------------------------------------------
  137. //    CContainerPart::GetMainPresentation
  138. //----------------------------------------------------------------------------------------
  139. inline FW_CPresentation* CContainerPart::GetMainPresentation() const
  140. {
  141.     return fMainPresentation;
  142. }
  143.  
  144. //----------------------------------------------------------------------------------------
  145. // CContainerPart_SetColor
  146. //----------------------------------------------------------------------------------------
  147.  
  148. void CContainerPart_SetColor(Environment* ev, void* refCon, short red, short green, short blue);
  149.  
  150. #endif
  151.